<template>
	<view>
		<u-navbar title="常用信息" :border-bottom='false'></u-navbar>
		<view class="main">
			<view class="tooslBtn">
				<view class="btn-item" @click="navTo('./addInfo')">
					<image class="icon" src="../../../static/imgs/zxjsb.png" mode=""></image>
					<text>识别证件新增</text>
				</view>
				<view class="btn-item"  @click="navTo('./addInfo')">
					<image class="icon" src="../../../static/imgs/zjsb.png" mode=""></image>
					<text>手动新增</text>
				</view>
				<view class="btn-item" @click="showModal = true">
					<image class="icon" src="../../../static/imgs/wxhysb.png" mode=""></image>
					<text>邀请好友填写</text>
				</view>
			</view>
			<view class="peo-ul">
				<view class="peo-li" @click="navTo('./editInfo')">
					<view class="left">
						<view class="name">
							小张
						</view>
						<view class="idNum">
							身份证 123568 ********** 2356
						</view>
						<view class="mobile">
							手机号码 123**** 2356
						</view>
					</view>
					<view class="right">
						<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
					</view>
				</view>
				<view class="peo-li">
					<view class="left">
						<view class="name">
							小张
						</view>
						<view class="idNum">
							身份证 123568 ********** 2356
						</view>
						<view class="mobile">
							手机号码 123**** 2356
						</view>
					</view>
					<view class="right">
						<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
					</view>
				</view>
			</view>
		</view>
<!-- 		<view class="main">
			<u-form :model="papersFrom" ref="uForm" label-position='top'>
				<u-form-item :border-bottom='false' label="身份证姓名" prop="real_name">
					<u-input v-model="papersFrom.real_name" placeholder='请输入身份证姓名' />
				</u-form-item>
				<u-form-item :border-bottom='false' label="身份证号码" prop="id_no">
					<u-input v-model="papersFrom.id_no" placeholder='请输入身份证号码' />
				</u-form-item>
				<u-form-item :border-bottom='false' label="护照姓名" prop="passport_name">
					<u-input v-model="papersFrom.passport_name" placeholder='请输入护照姓名' />
				</u-form-item>
				<u-form-item :border-bottom='false' label="护照号码" prop="passport_no">
					<u-input v-model="papersFrom.passport_no" placeholder='请输入护照号码' />
				</u-form-item>
			</u-form>
			<view class="sunBtn" @click="submitBtn">
				保存证件信息
			</view>
		</view> -->
		<u-modal v-model="showModal" :content="content" title='邀请好友填写' show-cancel-button @confirm="confirmFn"></u-modal>
	</view>
</template>

<script>
	import myRequest from '../../../api/index.js'
	export default {
		data() {
			return {
				showModal:false,
				content:'将常用信息填写表发给好友填写'
				// papersFrom: {
				// 	real_name: '',
				// 	id_no: '',
				// 	passport_name: '',
				// 	passport_no: ''
				// },
				// rules: {
				// 	real_name: [{
				// 		required: true,
				// 		message: '请输入身份证姓名',
				// 		trigger: 'blur',
				// 	}],
				// 	id_no: [{
				// 		required: true,
				// 		message: '请输入身份证号码',
				// 		trigger: 'blur'
				// 	}],
				// 	passport_name: [{
				// 		required: true,
				// 		message: '请输入护照姓名',
				// 		trigger: 'blur'
				// 	}],
				// 	passport_no: [{
				// 		required: true,
				// 		message: '请输入护照号码',
				// 		trigger: 'blur'
				// 	}]
				// }
			}
		},
		onReady() {
			// this.$refs.uForm.setRules(this.rules);
		},
		methods: {
			confirmFn(){
				console.log('点击了确认')
			},
			navTo(url){
				uni.navigateTo({
					url:url
				})
			},
			// submitBtn() {
			// 	this.$refs.uForm.validate(async valid => {
			// 		if (valid) {
			// 			console.log('验证通过')
			// 			let res = await myRequest.setUserInfo(this.papersFrom)
			// 			if (res.status) {
			// 				uni.showToast({
			// 					title: '保存成功'
			// 				})
			// 				this.papersFrom = {}
			// 			}
			// 		} else {
			// 			console.log('验证失败');
			// 		}
			// 	});
			// }
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		padding-top: 40rpx;
		.tooslBtn {
			width: 690rpx;
			height: 148rpx;
			background-color: #FFFFFF;
			border-radius: 16rpx;
			margin: 0 auto;
			display: flex;
			.btn-item {
				flex: 1;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				.icon {
					width: 36rpx;
					height: 36rpx;
				}
				text {
					margin-top: 6rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					line-height: 20px;
					color: #333333;
				}
			}
		}
	
		.peo-ul {
			margin-top: 40rpx;
			width: 100%;
			height: auto;
			background-color: #FFFFFF;
			padding: 0 28rpx;
			.peo-li {
				padding: 18rpx 0;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 2rpx solid #F2F2F7;
				.name {
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #333333;
				}
				.idNum {
					margin-top: 20rpx;
				}
				.idNum,
				.mobile{
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
				}
				.mobile {
					margin-top: 8rpx;
				}
				&:last-child {
					border-bottom:none
				}
			}
		}
	}
</style>
